package com.note.chh.notebook.Adapter;

import android.graphics.Color;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.note.chh.notebook.Model.WeatherModel;
import com.note.chh.notebook.R;
import com.note.chh.notebook.Widget.CircleImageView;


/**
 * Created by caihuahui on 2018/3/7.
 */

public class LifestyleAdapter extends BaseQuickAdapter<WeatherModel.HeWeather6Bean.LifestyleBean,BaseViewHolder> {
    public LifestyleAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, WeatherModel.HeWeather6Bean.LifestyleBean item) {
        CircleImageView circleImageView = helper.getView(R.id.civ_suggesstion);
        helper.setText(R.id.tvMsg,item.getBrf());
        switch (item.getType()) {
            case "air"://空气
                helper.setText(R.id.tvName,"空气");
                circleImageView.setImageResource(R.drawable.ic_air);
                circleImageView.setFillColor(Color.parseColor("#FF7F9EE9"));
                break;
            case "comf"://舒适度
                helper.setText(R.id.tvName,"舒适度");
                circleImageView.setImageResource(R.drawable.ic_comf);
                circleImageView.setFillColor(Color.parseColor("#FFE99E3C"));
                break;
            case "cw"://洗车
                helper.setText(R.id.tvName,"洗车");
                circleImageView.setImageResource(R.drawable.ic_cw);
                circleImageView.setFillColor(Color.parseColor("#FF62B1FF"));
                break;
            case "drsg"://穿衣
                helper.setText(R.id.tvName,"穿衣");
                circleImageView.setImageResource(R.drawable.ic_drsg);
                circleImageView.setFillColor(Color.parseColor("#FF8FC55F"));
                break;
            case "flu"://感冒
                helper.setText(R.id.tvName,"感冒");
                circleImageView.setImageResource(R.drawable.ic_flu);
                circleImageView.setFillColor(Color.parseColor("#FFF98178"));
                break;
            case "sport"://运动
                helper.setText(R.id.tvName,"运动");
                circleImageView.setImageResource(R.drawable.ic_sport);
                circleImageView.setFillColor(Color.parseColor("#FFB3CA60"));
                break;
            case "trav"://旅游
                helper.setText(R.id.tvName,"旅游");
                circleImageView.setImageResource(R.drawable.ic_trav);
                circleImageView.setFillColor(Color.parseColor("#FFFD6C35"));
                break;
            case "uv"://紫外线
                helper.setText(R.id.tvName,"紫外线");
                circleImageView.setImageResource(R.drawable.ic_uv);
                circleImageView.setFillColor(Color.parseColor("#FFF0AB2A"));
                break;
            default:
                helper.setText(R.id.tvName,"空气");
                circleImageView.setImageResource(R.drawable.ic_air);
                circleImageView.setFillColor(Color.parseColor("#FF7F9EE9"));
                break;
        }
    }


}
